package com.cssw.fyzb.core.dao.live;

import com.cssw.fyzb.core.model.dodb.CmfLive;
import com.cssw.fyzb.core.model.dodb.CmfLiveKickOut;
import com.cssw.fyzb.core.model.dodb.CmfLiveMute;
import com.cssw.fyzb.core.model.dodb.CmfUserLive;
import com.ydn.dbframe.plugin.activerecord.Page;

import java.util.List;
import java.util.Map;

public interface LiveDao {

    CmfLive findOne(Long liveId);

    CmfLive getLivingByUserId(Long userId);

    Long createRoom(Long userId, Long anchorId, String title, String thumb, String push, String pull, String accelerate, String lat, String lng, String province, String city);

    void incLikes(Long liveId, Integer likes);

    void incViews(Long liveId, Integer views);

    void pk(Long liveId, String pk);

    Page<CmfLive> listLiveFriend(Long userId, Integer pageNumber, Integer pageSize);

    void dropRoom(Long liveId);

    /**
     * 查询被踢
     *
     * @param id
     * @return
     */
    public CmfLiveKickOut queryLiveKickOutById(Long id);

    /**
     * 查询被踢
     *
     * @param liveId
     * @param operUserId
     * @param userId
     * @return
     */
    public CmfLiveKickOut queryLiveKickOut(Long liveId, Long operUserId, Long userId);

    /**
     * 踢人
     *
     * @param liveId
     * @param operUserId
     * @param userId
     * @return
     */
    Long addLiveKickOut(Long liveId, Long operUserId, Long userId);

    /**
     * 取消踢人
     *
     * @param id
     * @return
     */
    void removeLiveKickOutById(Long id);

    /**
     * 获取踢出列表
     *
     * @return
     */
    Page<CmfLiveKickOut> listLiveKickOut(Long liveId, Integer pageNumber, Integer pageSize);

    /**
     * 获取踢出列表
     *
     * @return
     */
    List<CmfLiveKickOut> listLiveKickOut(Long liveId);

    /**
     * 查询禁言
     *
     * @param id
     * @return
     */
    public CmfLiveMute queryLiveMuteById(Long id);

    /**
     * 查询禁言
     *
     * @param liveId
     * @param operUserId
     * @param userId
     * @return
     */
    public CmfLiveMute queryLiveMute(Long liveId, Long operUserId, Long userId);

    /**
     * 禁言
     *
     * @param liveId
     * @param operUserId
     * @param userId
     * @return
     */
    Long addLiveMute(Long liveId, Long operUserId, Long userId);

    /**
     * 取消禁言
     *
     * @param id
     * @return
     */
    void removeLiveMuteById(Long id);

    /**
     * 获取禁言列表
     *
     * @return
     */
    Page<CmfLiveMute> listLiveMute(Long liveId, Integer pageNumber, Integer pageSize);

    /**
     * 获取禁言列表
     *
     * @return
     */
    List<CmfLiveMute> listLiveMute(Long liveId);

    /**
     * 获取直播列表
     *
     * @return
     */
    Page<CmfLive> listLive(Map param, Integer pageNumber, Integer pageSize);

    /**
     * 获取随机直播列表
     *
     * @return
     */
    Page<CmfLive> randomPkLive(Map param, Integer pageNumber, Integer pageSize);

    /**
     * 搜索直播列表
     *
     * @return
     */
    Page<CmfLive> searchLive(Map param, Integer pageNumber, Integer pageSize);

    /**
     * 更新连麦状态
     *
     * @param liveId
     * @param lianmai
     */
    void updateLianmai(Long liveId, String lianmai);

    /**
     * 查询 用户直播表
     *
     * @return
     * @Param
     **/
    CmfUserLive getCmfUserLive(Long uid);
}
